const mysql = require('mysql')
const dbOption = require('./config')
const client = mysql.createConnection(dbOption)

function sqlFun(sql, arr, callback) {
  client.query(sql, arr, function (error, result) {
    if (error) {
      console.log('数据库语句错误')
      return
    }
    callback(result)
  })
}

module.exports=sqlFun
